acpi: Add support for old and new bios erst, enable mce_apei logic
authorLiu, Jinsong <jinsong.liu@intel.com>
Sat, 23 Jul 2011 07:55:59 +0000 (08:55 +0100)
committerLiu, Jinsong <jinsong.liu@intel.com>
Sat, 23 Jul 2011 07:55:59 +0000 (08:55 +0100)
When testing, we found different bios has different understanding
about APEI ERST table header, depending on whether it count ACPI
standard header or not.
This patch add support for both bios version, and enable mce_apei.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen/arch/x86/cpu/mcheck/Makefile
xen/drivers/acpi/apei/erst.c

index b768bd51c3728104fa24bf7ba2125f4df0d39687..36ec89e877d9d5c9960714629aba5569b6c93ec4 100644 (file)
@@ -4,7 +4,7 @@ obj-y += amd_k8.o
 obj-y += amd_f10.o
 obj-y += mctelem.o
 obj-y += mce.o
-#obj-y += mce-apei.o
+obj-y += mce-apei.o
 obj-y += mce_intel.o
 obj-y += mce_amd_quirks.o
 obj-y += non-fatal.o
index eb666a6fcab8e7c8cc9fc3c558116b4c357782a9..e012cd39e010171e333da5428abf214f9ac3cee7 100644 (file)
@@ -715,7 +715,13 @@ int erst_clear(u64 record_id)
 
 static int __init erst_check_table(struct acpi_table_erst *erst_tab)
 {
-       if (erst_tab->header_length != sizeof(struct acpi_table_erst))
+       /*
+        * Some old BIOSes include the ACPI standard header in the ERST header
+        * length; new BIOSes do not. Our check allows for both methods.
+        */
+       if ((erst_tab->header_length !=
+           (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header)))
+           && (erst_tab->header_length != sizeof(struct acpi_table_erst)))
                return -EINVAL;
        if (erst_tab->header.length < sizeof(struct acpi_table_erst))
                return -EINVAL;